//
//  CPUserDefaultsTool.m
//  Learner Kit
//
//  Created by Wade on 14-8-6.
//  Copyright (c) 2014年 .. All rights reserved.
//

#import "QKUserDefaultsTool.h"



@implementation QKUserDefaultsTool

+ (void)saveWithValue:(NSString *)value forKey:(NSString *)key
{
    NSUserDefaults *UserDef = [NSUserDefaults standardUserDefaults];
    [UserDef setObject:value forKey:key];
    [UserDef synchronize];
}

+ (NSString *)getValueForKey:(NSString *)key
{
    NSUserDefaults *UserDef = [NSUserDefaults standardUserDefaults];
   return [UserDef objectForKey:key];

}


+ (void)removeValueForKey:(NSString *)key
{
    NSUserDefaults *UserDef = [NSUserDefaults standardUserDefaults];
    [UserDef removeObjectForKey:key];
    [UserDef synchronize];
}

+ (id)getObjectValueForKey:(NSString *)key {
    NSUserDefaults *UserDef = [NSUserDefaults standardUserDefaults];
    return [UserDef objectForKey:key];
}
+ (void)saveWithObjectValue:(id)values forKey:(NSString *)key {
    NSUserDefaults *UserDef = [NSUserDefaults standardUserDefaults];
    [UserDef setObject:values forKey:key];
    [UserDef synchronize];
}

+ (NSInteger)getIntegerValueForKey:(NSString *)key
{
    NSUserDefaults *UserDef = [NSUserDefaults standardUserDefaults];
    return [UserDef integerForKey:key];
}

+ (void)saveWithIntegerValue:(NSInteger)value forKey:(NSString *)key
{
    NSUserDefaults *UserDef = [NSUserDefaults standardUserDefaults];
    [UserDef setInteger:value forKey:key];
    [UserDef synchronize];
}


+ (float)getFloatValueForKey:(NSString *)key {
    NSUserDefaults *UserDef = [NSUserDefaults standardUserDefaults];
    return [UserDef floatForKey:key];
}

+ (void)saveWithFloatValue:(float)value forKey:(NSString *)key {
    NSUserDefaults *UserDef = [NSUserDefaults standardUserDefaults];
    [UserDef setFloat:value forKey:key];
    [UserDef synchronize];
}


@end
